package com.spring.common.web;

import lombok.Data;

@Data
public class CommRes {
    private String code;
    private String msg;
    private Object data;
    public static CommRes success(Object data){
        CommRes commRes = new CommRes();
        commRes.setCode("200");
        commRes.setMsg("操作成功");
        commRes.setData(data);
        return commRes;
    }
    public static CommRes fail(String msg){
        CommRes commRes = new CommRes();
        commRes.setCode("400");
        commRes.setMsg(msg);
        commRes.setData("");
        return commRes;
    }
}
